package com.vivz.baby;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {

    private Button btnLogging;
    private Button btnListing;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // initialize the buttons
        initializeButtons();
    }

    private void initializeButtons() {
        btnLogging = (Button) findViewById(R.id.btn_logging_id);
		btnListing = (Button) findViewById(R.id.btn_listing_id);
		initializeListeners();
    }

    private void initializeListeners() {

        btnLogging.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                final Intent intent = new Intent(getApplicationContext(), LoggingActivity.class);
                startActivity(intent);
            }
        });

        btnListing.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                final Intent intent = new Intent(getApplicationContext(), ListingActivity.class);
                startActivity(intent);
            }
        });
    }

}
